import { PrismaClient } from '@prisma/client'
import { getQuery } from 'h3'
const prisma = new PrismaClient()

export default defineEventHandler(async (event) => {
    const { postId } = await getQuery(event)
    const post = await prisma.post.update({
        where: {id: Number(postId)},
        data: {deletedAt: new Date()},
    })
    return {
        code: 0,
        data: post
    }
})
